import time

from selenium import webdriver
from selenium.webdriver.common.by import By
driver = webdriver.Chrome()
driver.get('file:///D:/gao5biji/frame_tc/prompt.html')
time.sleep(2)
driver.find_element(By.ID,'button').click()
time.sleep(2)
alert = driver.switch_to.alert
time.sleep(2)
alert.send_keys('这是一个prompt弹窗')
time.sleep(2)
# alert.dismiss()
alert.accept()
time.sleep(5)
driver.quit()